$("#back").on("click",function(){
    window.location.href = "toDataDicetionary";
});

$("#addUserBtn").click(function () {
    var typeCode = $("#typeCode").val();
    var typeName = $("#typeName").val();
    var valueId = $("#valueId").val();
    var valueName = $("#valueName").val();
    if (typeCode=='' || typeCode==null){
        alert("类型编码不能为空！")
    }
    if (typeName=='' || typeName==null){
        alert("类型名称不能为空！")
    }
    if (valueId=='' || valueId==null){
        alert("类型值ID不能为空！")
    }
    if (valueName=='' || valueName==null){
        alert("类型值Name不能为空！")
    }
    $.ajax({
        url:'addDataDictionary',
        data:{
            typeCode:typeCode,
            typeName:typeName,
            valueId:valueId,
            valueName:valueName
        },
        type:'post',
        dataType:'json',
        success:function (data) {
            if (data.code=="1"){
                alert("添加成功！")
                window.location.href="toDataDicetionary";
            }else {
                alert(data.message);
                return;
            }
        }
    })
})